/*
 * Powered By [pkuWx]
 * Web Site: http://www.wuxi.ss.pku.edu.cn
 * Since 2015 - 2015
 */

package cn.edu.pku.wxlib.teacher.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javacommon.base.BaseEntity;

/**
 * @version 1.0
 * @since 1.0
 */


public class Teacher extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "Teacher";
	public static final String ALIAS_TEACHER_ID = "teacherId";
	public static final String ALIAS_TEACHER_NUMBER = "teacherNumber";
	public static final String ALIAS_DEPARTMENT = "department";
	public static final String ALIAS_DIRECTION = "direction";
	public static final String ALIAS_TITLE = "title";
	public static final String ALIAS_OFFICE = "office";
	
	//date formats
	
	//columns START
    /** teacherId       db_column: teacherId */	
	
	private java.lang.Integer teacherId;
    /** teacherNumber       db_column: teacherNumber */	
	@NotBlank @Length(max=10)
	private java.lang.String teacherNumber;
    /** department       db_column: department */	
	@NotBlank @Length(max=32)
	private java.lang.String department;
    /** direction       db_column: direction */	
	@NotBlank @Length(max=128)
	private java.lang.String direction;
    /** title       db_column: title */	
	@NotBlank @Length(max=64)
	private java.lang.String title;
    /** office       db_column: office */	
	@NotBlank @Length(max=32)
	private java.lang.String office;
	//columns END

	public Teacher(){
	}

	public Teacher(
		java.lang.Integer teacherId
	){
		this.teacherId = teacherId;
	}

	public void setTeacherId(java.lang.Integer value) {
		this.teacherId = value;
	}
	
	public java.lang.Integer getTeacherId() {
		return this.teacherId;
	}
	public void setTeacherNumber(java.lang.String value) {
		this.teacherNumber = value;
	}
	
	public java.lang.String getTeacherNumber() {
		return this.teacherNumber;
	}
	public void setDepartment(java.lang.String value) {
		this.department = value;
	}
	
	public java.lang.String getDepartment() {
		return this.department;
	}
	public void setDirection(java.lang.String value) {
		this.direction = value;
	}
	
	public java.lang.String getDirection() {
		return this.direction;
	}
	public void setTitle(java.lang.String value) {
		this.title = value;
	}
	
	public java.lang.String getTitle() {
		return this.title;
	}
	public void setOffice(java.lang.String value) {
		this.office = value;
	}
	
	public java.lang.String getOffice() {
		return this.office;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("TeacherId",getTeacherId())
			.append("TeacherNumber",getTeacherNumber())
			.append("Department",getDepartment())
			.append("Direction",getDirection())
			.append("Title",getTitle())
			.append("Office",getOffice())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getTeacherId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof Teacher == false) return false;
		if(this == obj) return true;
		Teacher other = (Teacher)obj;
		return new EqualsBuilder()
			.append(getTeacherId(),other.getTeacherId())
			.isEquals();
	}
}

